<!DOCTYPE html>
<html>
	<head>
	<meta charset="UTF-8">
	<title>忘记密码</title>
	<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
	<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
	<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
	<style>
		body{
			background: #f3f3f3;
		}
		.container{
			margin: 64px auto auto auto;
			width: 400px;
		}
		.title{
			text-align: center;
		}
		.login{
			margin-top: 64px;
		}
		.btn_group{
			text-align: center;
		}
		.alter_password{
			text-align: right;
			padding: 8px;
		}
		.return_result{
			padding: 8px;
			text-align: center;
		}
	</style>
	</head>
	<body>
	<div class="container">
		<h1 class="title">忘记密码</h1>
		<div class="login">
			<div class="panel panel-default">
				<div class="panel-body">
					<div class="form-group" id="input1">
						<label class="control-label" for="inputError1" id="inputError1"></label>
						<input type="text" class="form-control" id="emailInput" placeholder="邮箱">
					</div>
					<div class="form-group" id="input4">
						<label class="control-label" for="inputError4" id="inputError4"></label>
						<input type="text" class="form-control" id="verifyInput" placeholder="验证码">
						
					</div>
	
					<div class="btn_group">
						<div>
							<a href="javascript:;">
								<img src="captcha.do" id="captcha">
							</a>
							<br><br>
						</div>
						<button type="button" class="btn btn-primary" id="regBtn">确 定</button>
					</div>
					<div class="return_result"></div>
				</div>
			</div>
		</div>
	</div>
	
	<script>
		
		$(".btn-primary").click(function(){
			var emial = $("#emailInput").val();
			var verify = $("#verifyInput").val();
			$.post('forget.do',{
				email:emial,
				verify:verify
			},function(data){
			try{
				console.log(data);
				var ret = JSON.parse(data);
				if(ret.error == 0)
				{
					$(".return_result").html("邮件发送成功，请到邮箱去验证。");
				}
				else{
					$(".return_result").html("发送邮件失败，请重新发送。");
				}
			}catch(e){
				//TODO handle the exception
			}
		});
	})
		
	</script>
	
	</body>
</html>
